package com.stu.mapper;

import com.stu.Dto.StuLoginDto;
import com.stu.pojo.ClassJobApplication;
import com.stu.pojo.Login;
import com.stu.vo.ClassJobApplicationVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ClassInformationMapper {

    /**
     * 添加学生申请班委信息
     * @param classJobApplication
     */
    @Insert("insert into class_job_application(stu_id, class_job, application_time, class_id)" +
            "values (#{stuId},#{classJob},#{applicationTime},#{classId})")
    void insertClassJobApplication(ClassJobApplication classJobApplication);

    /**
     * 查询班委申请进度
     * @param currentId
     * @return
     */
    @Select("select * from class_job_application where stu_id = #{currentId}")
    List<ClassJobApplicationVo> selectJobApplication(Long currentId);


    void updateClassJob(ClassJobApplication classJobApplication);

    @Select("select * from class_job_application")
    List<ClassJobApplicationVo> selectJobApplicationAll();

    @Select("select id from class_information where class_name = #{classInfo}")
    Integer selectClassIdByStuClassInfo(String classInfo);
}
